﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Xml;

namespace Gollie.Invoice
{
	public class FeeCollection : Collection<Fee>
	{
		internal void Read(XmlNode node)
		{
			foreach (XmlNode feeNode in node.SelectNodes("fee"))
			{
				decimal upperBound = XmlConvert.ToDecimal(feeNode.Attributes["upperbound"].Value);
				decimal percentage = XmlConvert.ToDecimal(feeNode.Attributes["percentage"].Value);

				this.Add(new Fee { UpperBound = upperBound, Percentage = percentage });
			}
		}
	}
}
